function data=initialize_data

    %%%%%%%%%%%%%%%%%%%%%%%%%
    % LOAD DATA
    %%%%%%%%%%%%%%%%%%%%%%%%%

load data_BHP2.mat;

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % TRIM IN PRICE AND INCOME DIMENSION
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

select=(log_y>log(15000)) & (log_p>log(1.20));
log_p=log_p(select);
log_y=log_y(select);
log_q=log_q(select);
distance_oil1000=distance_oil1000(select);

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % DEFINE VARIABLES
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

p=log_p;
y=log_y;
share=exp(log_q + log_p - log_y);
Z=distance_oil1000;
N=size(share,1);

clear log_p log_p log_y distance_oil1000

log_y_mu=11.13134190994903;
log_y_sd=0.5613085562586437;
   
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % DEFINE GRID
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        
p_grid=61;
y_grid=3;

p_point_low=percentiles(p,5);
p_point_high=percentiles(p,95);

p_interest_univ=log(linspace(exp(p_point_low),exp(p_point_high),p_grid))';
y_interest_univ=[log(42500); log(57500); log(72500)];

y_interest_detail=log([17500; 22500; 27500; 32500; 37500; 42500; 47500; 52500; 57500; 62500; 67500; 72500; 77500; 90000; 120000]);

p_interest=kron(p_interest_univ,ones(y_grid,1));
y_interest=kron(ones(p_grid,1),y_interest_univ);

p_grid_constraint=kron(p_interest_univ,ones(size(y_interest_detail,1),1)); 
y_grid_constraint=kron(ones(size(p_interest_univ,1),1),y_interest_detail); 

    %%%%%%%%%%%%%%%%%%%%%%%%%
    % ASSIGN
    %%%%%%%%%%%%%%%%%%%%%%%%%

data.p=p;
data.y=y;
data.share=share;
data.Z=Z;
data.N=N;

data.p_interest=p_interest;
data.y_interest=y_interest;
data.p_interest_univ=p_interest_univ;
data.y_interest_univ=y_interest_univ;

data.p_grid_constraint=p_grid_constraint;
data.y_grid_constraint=y_grid_constraint;

data.log_y_mu=log_y_mu;
data.log_y_sd=log_y_sd; 

    %
